#include <math.h>
#include <stdio.h>
    int main(){
        int  f = 1;
        double pi = 0.0, t = 1.0, n = 1.0;
        while (fabs(t) >= 0.000001){          
            pi = pi + t;
            n = n + 2;
            f = -f;
            t = f / n;
        }
        printf("result=%lf", 4 * pi);
        return 0;
}